import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import type {RouteRecordRaw} from "vue-router"
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/index',
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/HomeView.vue'),
    children:[
      {
        path: '/index',
        name: 'index',
        component: () => import('@/views/index/index.vue'),
      }, {
        path: '/fagui',
        name: 'fagui',
        component: () => import('@/views/pages/fagui.vue'),
      }, {
        path: '/ziliao',
        name: 'ziliao',
        component: () => import('@/views/pages/ziliao.vue'),
      }, {
        path: '/anli',
        name: 'anli',
        component: () => import('@/views/pages/anli.vue'),
      }, {
        path: '/reci',
        name: 'reci',
        component: () => import('@/views/pages/reci.vue'),
      }
    ]
  },
]
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
})

router.beforeEach((to, from, next) => {
  next();
})

export default router
